import { ApiProperty } from '@nestjs/swagger';
import { Exclude, Expose, Transform } from 'class-transformer';

/**
 * 标签响应DTO
 */
@Exclude()
export class TagResponseDto {
  @Expose()
  @ApiProperty({
    description: '标签ID',
    example: '123e4567-e89b-12d3-a456-426614174000',
  })
  id: string;

  @Expose()
  @ApiProperty({
    description: '标签名称',
    example: '紧急',
  })
  name: string;

  @Expose()
  @ApiProperty({
    description: '标签颜色（十六进制）',
    example: '#FF0000',
  })
  color: string;

  @Expose()
  @ApiProperty({
    description: '所属工作区ID',
    example: '123e4567-e89b-12d3-a456-426614174000',
  })
  workspaceId: string;

  @Expose()
  @ApiProperty({
    description: '创建时间',
    example: '2024-03-08T10:30:00Z',
  })
  @Transform(({ value }) => value && new Date(value).toISOString())
  createdAt: Date;

  @Expose()
  @ApiProperty({
    description: '更新时间',
    example: '2024-03-08T10:30:00Z',
  })
  @Transform(({ value }) => value && new Date(value).toISOString())
  updatedAt: Date;
}

export class TagListResponseDto {
  @ApiProperty({
    description: '标签列表',
    type: [TagResponseDto],
  })
  tags: TagResponseDto[];

  @ApiProperty({
    description: '总数',
    example: 10,
  })
  total: number;
} 